import { URL } from "./url";
import req from "./axiosFun";

// 发送验证码接口
export const sendcode = (data) => {
  return req({ url: `${URL}/bicycle/users/code`, method: "post", data });
};

// 注册接口(*)
export const register = (data) => {
  return req({ method: "post", url: `${URL}/bicycle/users/register`, data });
};

// 登录接口(*)
export const login = (data) => {
  return req({ method: "post", url: `${URL}/bicycle/users/login`, data });
};
// 获取验证码

// 获取所有用户(*)
export const allusers = () => {
  return req({ url: `${URL}/bicycle/users/alls` });
};

// 获取所有用户(*)
export const administrator = () => {
  return req({ url: `${URL}/bicycle/users/administrator` });
};
// 获取所有用户(*)
export const updateGrade = (data) => {
  return req({ url: `${URL}/bicycle/users/updateGrade`, method: "post", data });
};

// 修改用户信息(*)
export const update = (data) => {
  return req({
    method: "post",
    url: `${URL}/bicycle/users/updateList`,
    data,
  });
};

// 删除用户接口(*)
export const deleteUser = (params) => {
  return req({ url: `${URL}/bicycle/users/delete/${params}` });
};
